/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package woowcrawler.html;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Leafarneo
 */
public class teste {
    public static void main(String[] args){
        try {
            WoowDocument doc=new WoowDocument("<html>texto <b> b <b>l</b>a</b> bla bla bl <a href=\"www.google.com\" class=\"css\">link</a> sfs<p id=\"id\">paragrafo</p> sa<br>d fsdf</html>");
            Tag raiz=doc.getHtmlElement();
            Tag[] tags=raiz.getTagsByName("b");
            for (int i = 0; i < tags.length; i++) {
                Tag tag = tags[i];
                System.out.println(tag);
            }
            System.out.println("por id>> "+raiz.getTagById("id"));
            Tag[] tags2=raiz.getTagsByAttribute("class","css");
            for (int i = 0; i < tags2.length; i++) {
                Tag tag = tags2[i];
                System.out.println("por atributo>> "+tag);
            }

        } catch (Exception ex) {
            Logger.getLogger(teste.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
